<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <meta name="referrer" content="origin-when-cross-origin"/>
    <meta name="description"
          content=""/>
    <meta property="og:description"
          content=""/>
    <meta http-equiv="Cache-Control" content="no-transform"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <title>ICoding博客</title>
    <script src="https://cdn.ckeditor.com/ckeditor5/21.0.0/classic/ckeditor.js"></script>

    <link rel="stylesheet" href="/css/blog-common.min.css"/>

    <link type="text/css" rel="stylesheet" href="/css/cnblogs.css"/>
    <link type="text/css" rel="stylesheet" href="/css/custom.css"/>

    <link id="mobile-style" media="only screen and (max-width: 767px)" type="text/css" rel="stylesheet"
          href="/css/mobile-common.min.css"/>
    <style type="text/css">
        .post {
            border: 0px solid;
        }

        .postDesc {
            border-bottom: dashed 1px;
            text-align: right;
        }

        #edit-topic-title {
            width: 800px;
            height: 40px;
            margin: 8px;
            padding: 5px;
            font-size: larger;
        }
    </style>
    <script>
        var currentBlogId = 520;
        var currentBlogApp = 'GuoXiongfei';
        var isLogined = true;
        var isBlogOwner = false;
        var skinName = 'Custom';
        var visitorUserId = '4410638e-090f-e011-ac81-842b2b196315';
        var hasCustomScript = true;
        window.cb_enable_mathjax = true;
        window.mathEngine = 0;
        window.codeHighlightEngine = 1;
        window.enableCodeLineNumber = false;
        window.codeHighlightTheme = 'cnblogs';
        window.isDarkCodeHighlightTheme = false;
        window.isDisableCodeHighlighter = false;
    </script>
    <script>
        var currentPostDateAdded = '2022-06-22 21:38';
    </script>
    <script src="/js/jquery-2.2.0.min.js"></script>
    <script src="/js/blog-common.min.js?t=01011"></script>

    <script>
        var topicData = null;

        function fn_topic(topic) {
            document.title = topic.title + "  - ICoding博客";
            topicData = topic;
            //设置编辑器内容
            myEditor.setData(topic.bodyText);
            $("#topics #edit-topic-title").val(topic.title);
            var signature = '<p>原文作者：' + topic.author + '</p>';
            signature += '<p>原文链接：' + topic.link + '</p>';
            signature += '<p>版权声明：本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。</p>';
            $("#post-signature").html(signature);
            //$("#topics h1 a").attr("href", "/topic5.html?id=" + topic.docId);
            var bodyText = [];
            if (topic.picUrl) {
                bodyText.push('<img src="' + topic.picUrl + '" /><br/>');
            }
            bodyText.push(topic.bodyText);
            if (topic.picUrl2) {
                var pics = topic.picUrl2.split(";");
                for (var i = 0; i < pics.length; i++) {
                    bodyText.push('<br/><img src="' + pics[i] + '" />');
                }
            }
            //document.getElementById("topic_content").innerHTML = bodyText.join("");
            //$("#cnblogs_post_body").html(bodyText.join(""));
        }


        var localId = window.location.href.substring(window.location.href.indexOf("id=") + 3);
        jsonp({
            url: blog_host + "/admin/get?domain=www.guoxiongfei.cn&id=" + localId,
            data: {
                name: "小明",
            },
            success: function (obj) {
                console.log("obj=", obj);
            }
        });
    </script>
</head>
<body class="skin-custom has-navbar mathjax2">
<a name="top"></a>
<div id="top_nav" class="navbar forpc">
    <nav id="nav_main" class="navbar-main">
        <ul id="nav_left" class="navbar-list navbar-left">
            <li>
                <a href="/">首页</a>
            </li>
            <li>
                <a href="https://www.guoxiongfei.cn/" onclick="countClicks('nav', 'skin-navbar-news')">新闻</a>
            </li>
            <li>
                <a href="http://www.guoxiongfei.cn/" onclick="countClicks('nav', 'skin-navbar-q')">博问</a>
            </li>
        </ul>
        <ul id="nav_right" class="navbar-list navbar-right">
            <li>
                <form id="zzk_search" class="navbar-search" action="http://www.guoxiongfei.cn/search.html?q="
                      method="get"
                      role="search">
                    <input name="w" id="zzk_search_input" placeholder="代码改变世界" type="search" tabindex="3"/>
                    <button type="submit" id="zzk_search_button">
                        <img src="/images/aggsite/search.svg" alt="搜索"/>
                    </button>
                </form>
            </li>
        </ul>
    </nav>
</div>

<div id="page_begin_html">
    <div id="loading">
        <div class="boxLoading"></div>
    </div>
</div>

<!--done-->
<div id="home">
    <div id="header">
        <div id="blogTitle">
            <a id="lnkBlogLogo" href="https://www.cnblogs.com/GuoXiongfei/"><img id="blogLogo"
                                                                                 src="/skins/custom/images/logo.gif"
                                                                                 alt="返回主页"/></a>

            <!--done-->
            <h1><a id="Header1_HeaderTitle" class="headermaintitle HeaderMainTitle"
                   href="https://www.cnblogs.com/GuoXiongfei/">GuoXiongfei</a>
            </h1>
        </div><!--end: blogTitle 博客的标题和副标题 -->
        <div id="navigator">

            <ul id="navList">
                <li>
                    <a id="blog_nav_myhome" class="menu" href="https://www.guoxiongfei.cn">
                        首页</a>
                </li>
                <li>
                    <a id="blog_nav_contact" class="menu" href="https://www.guoxiongfei.cn/post.html">
                        联系</a></li>
                <li>
                    <a id="blog_nav_rss" class="menu" href="javascript:void(0)"
                       data-rss="https://www.guoxiongfei.cn/rss/">
                        订阅</a></li>
            </ul>


        </div><!--end: navigator 博客导航栏 -->
    </div><!--end: header 头部 -->
    <div id="main">
        <div id="mainContent" style="padding: 0px 20px">
            <div class="forFlow">
                <div id="post_detail">
                    <!--done-->
                    <div id="topics">
                        <div class="post">
                            <h1 class="postTitle">
                                <input type="text" id="edit-topic-title"/>
                                <input type="button" value="更新标题" onclick="updateTitle()"/>
                            </h1>
                            <div class="clear"></div>
                            <div class="postBody">
                                <!--<textarea id="edit-post-bode" cols="120" rows="50">
                                </textarea>-->
                                <!-- 加载编辑器的容器 -->
                                <script id="container" name="content" type="text/plain">
                                </script>
                                <!-- ckeditor 配置文件  container -->
                                <script>
                                    var myEditor = null;
                                    ClassicEditor
                                        .create(document.querySelector('#container'), {
                                            // config
                                            toolbar: ['heading',
                                                '|',
                                                'bold',
                                                'italic',
                                                'underline',
                                                'fontColor',
                                                'fontBackgroundColor',
                                                'fontSize',
                                                'fontFamily',
                                                'highlight',
                                                'bulletedList',
                                                'numberedList',
                                                '|',
                                                'indent',
                                                'outdent',
                                                '|',
                                                'link',
                                                /*                'imageUpload',
                                                                'imageInsert',
                                                                'mediaEmbed',*/
                                                '|',
                                                'blockQuote',
                                                'strikethrough',
                                                'specialCharacters',
                                                'superscript',
                                                'subscript',
                                                'insertTable',
                                                'undo',
                                                'redo',
                                                'alignment'], language: 'zh-cn'
                                        })
                                        .then(editor => {
                                            // do something
                                            //$("#container").innerText = "<div>my god !!!</div>";
                                            myEditor = editor;
                                        })
                                        .catch(error => {
                                            console.error(error);
                                        });

                                </script>
                                <div style="text-align: center;">
                                    <input type="button" value="更新正文" onclick="updateBody()"/>
                                </div>
                                <div id="cnblogs_post_body" class="blogpost-body cnblogs-markdown">

                                </div>

                                <div class="clear"></div>
                                <div id="blog_post_info_block" role="contentinfo">
                                    <div id="blog_post_info"></div>
                                    <div class="clear"></div>
                                    <div id="post_next_prev"></div>
                                </div>
                            </div>
                            <div class="postDesc" style="display: none;">posted @
                                <span id="post-date">2022-06-22 21:38</span>&nbsp;
                                <a href="https://www.cnblogs.com/GuoXiongfei/">GuoXiongfei</a>&nbsp;
                                阅读(<span id="post_view_count">467</span>)&nbsp;
                            </div>
                        </div>


                    </div><!--end: topics 文章、评论容器-->
                </div>

            </div><!--end: forFlow -->
        </div><!--end: mainContent 主体内容容器-->
        <div id="sideBar">
            <div id="sideBarMain">
                <div id="blog-calendar" style="display:none"></div>
                <div id="leftcontentcontainer">
                    <div id="blog-sidecolumn"></div>
                </div>
            </div><!--end: sideBarMain -->
        </div><!--end: sideBar 侧边栏容器 -->
        <div class="clear"></div>
    </div><!--end: main -->
    <div class="clear"></div>
    <div id="footer">
        <!--done-->
        Copyright &copy; 2022 www.GuoXiongfei.cn
    </div><!--end: footer -->
</div><!--end: home 自定义的最大容器 -->


<div id="page_end_html">
    <script type="application/javascript" src="https://guangzan.gitee.io/awescnb/index.js"></script>
    <script type="application/javascript" src="/js/blog-commom-footer.js"></script>
</div>

</body>

<script type="application/javascript">
    $(function () {
        if (!rf) {
            initMenu();
        }
    });
    if (window.location.href.indexOf("www.blog.com") > 0) {
        blog_host = "http://localhost:8080";
    }

    function updateTitle() {
        var newData = $("#edit-topic-title").val();
        $.ajax({
            url: blog_host + "/base/update",
            headers: {
                'Content-Type': 'application/json;charset=utf-8',
            },
            type: 'post', //请求方式
            dataType: 'json', //返回的数据格式
            data: JSON.stringify({
                "docId": localId,
                "type": "title",
                "token": token || "admin",
                "domain": "www.guoxiongfei.cn",
                "data": newData
            })
        }).done(function (dat) {
            // 请求成功之后要执行的回调函数
            console.log(dat)
        }).fail(function (e) {
            console.log(e)
            // 请求失败之后要执行的回调函数
            alert('请求失败')
        });
    }

    function updateBody() {
        var newData = myEditor.getData();
        $.ajax({
            url: blog_host + "/base/update",
            headers: {
                'Content-Type': 'application/json;charset=utf-8',
            },
            type: 'post', //请求方式
            dataType: 'json', //返回的数据格式
            data: JSON.stringify({
                "docId": localId,
                "type": "body",
                "token": token || "admin",
                "domain": "www.guoxiongfei.cn",
                "data": newData
            })
        }).done(function (dat) {
            // 请求成功之后要执行的回调函数
            console.log(dat)
        }).fail(function (e) {
            console.log(e)
            // 请求失败之后要执行的回调函数
            alert('请求失败')
        });
    }
</script>

</html>